package com.woniuxy.carlife.carlifeuserweb.controller;


import com.woniuxy.carlife.carlifecommonsweb.exception.CarlifeGlobalException;
import com.woniuxy.carlife.carlifecommonsweb.responsetemplate.Result;
import com.woniuxy.carlife.carlifecommonsweb.responsetemplate.StatusCode;
import com.woniuxy.carlife.carlifecommonsweb.util.CopyUtil;
import com.woniuxy.carlife.carlifeusermodel.dto.CityDto;
import com.woniuxy.carlife.carlifeusermodel.dto.RegionDto;
import com.woniuxy.carlife.carlifeuserweb.entity.City;
import com.woniuxy.carlife.carlifeuserweb.entity.Region;
import com.woniuxy.carlife.carlifeuserweb.service.RegionService;
import com.woniuxy.carlife.carlifeuserweb.util.StatusMessageEnum;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author zjq
 * @ClassName:RegionController
 * @Description:
 * @date 2021/4/6 20:02
 **/

//@RestController
//@Api(tags = "查询区")//用于描述接口类的相关信息，作用于类上
//@RequestMapping("/region")
public class RegionController {

    @Resource
    RegionService regionService;

//    /*
//     * 功能描述〈根据市id查询地区〉
//     * @author:zjq
//     * @param:
//     * @return:
//     * @Date 2021/4/12 15:36
//     * @throws
//     */
//    //@ApiOperation用于描述接口方法，作用于方法上
//    @ApiOperation(value = "查询区，根据市id")
//
//    @ApiImplicitParams({
//            @ApiImplicitParam(name = "cityId", value = "市id"
//                    , example = "3", required = true, paramType = "query", dataType = "int")
//    })
//    @PostMapping("/ordinary/findRegionByCityId")
//    public Result findRegionByCityId(Integer cityId)  {
//        List<Region> regionByCityId = regionService.findRegionByCityId(cityId);
//        List<RegionDto> regionDtoList = CopyUtil.getList(regionByCityId, RegionDto.class);
//        return regionDtoList == null ?
//                new Result(false, StatusCode.ERROR, StatusMessageEnum.QUERY_IS_EMPTY.toString())
//                : new Result(true, StatusCode.OK, StatusMessageEnum.SEARCH_SUCCESSFUL.toString(), regionDtoList);
//    }

}

